Forum Discussion

TwieN's avatar
TwieN
Cloud Apps
07-14-2022
Solved

Dynamic filter with input parameter

I have this parameter from QbeeQ plugin called [@Days_Ago]. It should be used as a filter in formulas

For example: Calculate total sales with [Days Ago] < =  [@Days_Ago]
The formula would look like ([Total Sales] , [Days Ago]) while [Days Ago] column should filtered by [@Days_Ago] instead of a fixed value:

Please let me know how to achieve this. Much appreciated!

  • Hi TwieN ,

    It is not possible to add parameter variable into Sisense filter directly. However with our plugin you can achieve desired functionality in different way.

    It depends from your naming convention and data structure, but the logic of formula would look like below:

    sum([OrderID], case when [Min Days Ago] <= @Days Ago then [Total Sales] else 0 end)

    Order ID would be unique key here for each single transaction. Next in "case" statement it can be Min,Max,Avg, etc. from Days Ago, it doesn't really matter it will just return numerical output for the comparison with parameter variable.

    Let us know if you still have any questions. We'd also like to encourage you to reach out to us directly if you'll have any questions or issues related to our plugins.

    --
    Konrad Wróblewski
    QBeeQ 

1 Reply

Replies have been turned off for this discussion
  • Hi TwieN ,

    It is not possible to add parameter variable into Sisense filter directly. However with our plugin you can achieve desired functionality in different way.

    It depends from your naming convention and data structure, but the logic of formula would look like below:

    sum([OrderID], case when [Min Days Ago] <= @Days Ago then [Total Sales] else 0 end)

    Order ID would be unique key here for each single transaction. Next in "case" statement it can be Min,Max,Avg, etc. from Days Ago, it doesn't really matter it will just return numerical output for the comparison with parameter variable.

    Let us know if you still have any questions. We'd also like to encourage you to reach out to us directly if you'll have any questions or issues related to our plugins.

    --
    Konrad Wróblewski
    QBeeQ