Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team
can u please help with the below requirement
have bar chart with month as dimension and sum(sales) as measure
the requirement is as below
for example if we select march the bar chart should show from march to DEC.
and if we select June bar chart should show from june to dec .
and so on.. (from the selcted month to last month of the year)
thanks
siva
Hi Siva, you can do that with set analysis, in example, having a table with Month as number ans a Sales value the expression can be:
Sum({<Month={">=$(=Min(Month))"}>} Sales)
{<Month={">=$(=Min(Month))"}>} is the set analysis, it modifies the values selected for a particular expression, in this case it changes the values selcted in Month to select all months highre or equal to the lower month selected
When calculating Qlik first will expand $(), so $(=Min(Month)) will be converted to the value of the minimum month selected, if selected month is '5' the expression to calculate will be:
Sum({<Month={">=5"}>} Sales)
Hi Siva, you can do that with set analysis, in example, having a table with Month as number ans a Sales value the expression can be:
Sum({<Month={">=$(=Min(Month))"}>} Sales)
{<Month={">=$(=Min(Month))"}>} is the set analysis, it modifies the values selected for a particular expression, in this case it changes the values selcted in Month to select all months highre or equal to the lower month selected
When calculating Qlik first will expand $(), so $(=Min(Month)) will be converted to the value of the minimum month selected, if selected month is '5' the expression to calculate will be:
Sum({<Month={">=5"}>} Sales)
Hi Ruben,
thanks a lot for your prompt response
what if we have month as text instead of number will same expression work here
thanks
siva
Hi Siva,
No, you will need a field with month as number to make the >= comparison, if you don't have it as number you can create it in the same table, it can vary a lot (month names, date format...) but it can be something like:
Table:
LOAD Month
Num(Month(Date#(Month,'MMM'))) as NumMonth // if month='Dec' it should store 12
...
thank you