Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dears,
if I have a column called Price and the Price for each month is different than the next month and I need to present in Pivot table this column for the current month and the previous month beside each other.
how can I do that.
thank you for support.
Message was edited by: ahmad kastero
Friend;
In the dimension of the pivoting table, place the Months
Current Year Expression:
Sum({<[Year]={'$(=Max([Year]))'}>} [Field])
Previous Year Expression:
Sum({<[Year]={'$(=Max([Year])-1)'}>} [Field])
thank you Mario, but I try this and this is not worked, I need only to present the value no need to do Sum.
How is your expression? Can you put a printe of your PivotTable?
Can you share a sample of your requirement. in excel or others.
ITEM_CODE | Current Month | Previus Month |
COLUT0001 | 240 | 240 |
PMPBA0005 | 350 | 350 |
RMADT0013 | 28.609529 | 51.222157 |
RMADT0014 | 723.386042 | 716.25148 |
RMADT0023 | 29.061606 | 29.052239 |
RMADT0027 | 117.35559 | 118.465331 |
RMADT0042 | 66.341 | 64.713 |
RMDPT0004 | 146.45918 | 180.9 |
RMGPT0009 | 27.999999 | 187.5 |
RMOLT0002 | 116 | 27.999996 |
when I try to get this result it give me 0
and this is my expression :
only({<Month={"$(=Max(Month)-1)"}>} [Price of RM in Primary UOM])
and I try this :
vIgnoreAllDates: to ignore all date selection .
Sum({<vIgnoreAllDates,Month={"$(=Max(Month)-1)"}>} [Price of RM in Primary UOM])
Follow:
Sum({$< [Year]={$(=Year(AddMonths(Max([Date]),-1)))},
[Month]={$(=Month(AddMonths(Max([Date]),-1)))}
>} [Price of RM in Primary UOM])
If necessary, change the [Date] field name in the above expression;
-1 for previous month referring to the maximum date in the data model;
For previous months, only change from 1 to the desired one.
Recommend avoiding renaming of field names equal to the names of Qlik native functions.
I try to upload sample from the data in excel file but I don't know why it is not uploaded, but her is sample for two months
ITEM_CODE | Month1 | Price of RM in Primary UOM |
COLUT0001 | Jan | 240 |
PMPBA0005 | Jan | 350 |
RMADT0006 | Jan | |
RMADT0013 | Jan | 51.222157 |
RMADT0014 | Jan | 716.25148 |
RMADT0023 | Jan | 29.052239 |
RMADT0027 | Jan | 118.465331 |
RMADT0042 | Jan | 64.713 |
RMADT0047 | Jan | 180.9 |
RMDPT0004 | Jan | 187.5 |
RMGPT0009 | Jan | 27.999996 |
RMOLT0002 | Jan | 116 |
SFCRF0006 | Jan | |
COLUT0001 | Feb | 240 |
PMPBA0005 | Feb | 350 |
RMADT0006 | Feb | |
RMADT0013 | Feb | 28.609529 |
RMADT0014 | Feb | 723.386042 |
RMADT0023 | Feb | 29.061606 |
RMADT0027 | Feb | 117.35559 |
RMADT0042 | Feb | 66.341 |
RMDPT0004 | Feb | 146.45918 |
RMGPT0009 | Feb | 27.999999 |
RMOLT0002 | Feb | 116 |
SFCRF0006 | Feb |
I add the QVW sample