Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
madnanansari
Creator
Creator

Trend in Pivot table with Value list not working

I have define the below value list:

valuelist('Sales', 'Cost of Sales', 'GP')

Now I have define a Value formula as below:

if(  Valuelist($(vListHeads1)) ='Sales', $(vSalesCY),

     if(  Valuelist($(vListHeads1)) ='Cost of Sales', $(vCostOfSalesCY),

          if(  Valuelist($(vListHeads1)) ='GP', $(vGPCY),0

          )

     )

)

This function works fine.

Now I need to use a pivot table to show the trend by month of these variables. The filter is based on the month. If I have no selection, it shows totals for all months of the current year. but when I select a month, it don't show the totals (by month) for the that year. it just shows that month only.

The below is the formula I have used for vSalesCY.

If(getselectedcount([Month Year])<1,

Sum({$<[Statistics Name]={'Sales - Retail'}, [Year] = {"$(=Year(AddMonths(Today(),-1)))"} ,[Month No]=,[Month Year]=,[Month]=,[MonthID]= >} [Gl Report Month Balance] * Multiplier)

,

Sum({$<[Statistics Name]={'Sales - Retail'}, [Year] = {"$(=Max(Year))"},[Month No]=,[Month Year]=,[Month]=,[MonthID]= >} [Gl Report Month Balance] * Multiplier)

)

8 Replies
madnanansari
Creator
Creator
Author

I tried making simple pivot using value list and it don't work with the month trend. Without value list it works.

sunny_talwar

Would you be able to share a sample to show the issue?

madnanansari
Creator
Creator
Author

Pls. find attached the file.

In the sample dashboard, My requirement is if the user selects any month, it should show the figures for all month during the year.

sunny_talwar

Its a weird behavior... I would suggest creating an island table and use that instead of ValueList

Dim:

LOAD * Inline [

Dim

Sales

COS

];

Now Dim will be your new dimension and use an expression like this

Pick(Match(Only({1} Dim), 'Sales', 'COS'), $(vSalesCY), $(vCOSCY))

madnanansari
Creator
Creator
Author

this is not working. it gives the same thing as before.

sunny_talwar

Can you attach the updated qvw file where you have added the Inline Table into the app?

madnanansari
Creator
Creator
Author

pls. find attached the result app.

sunny_talwar

I am not sure why we are seeing this behavior... this might have been a new bug because I have never seen this before....