Skip to main content
Announcements
See why Qlik was named a Leader in the 2025 Gartner® Magic Quadrant™ for Augmented Data Quality Solutions: GET THE REPORT
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Creating auto generated columns

Hi all,

So I have a table showing some data for rolling 12 months (Last 12 months from Today()). Now every measure in this table has same logic for each column (Month). Have a look at the following example:

Jan 2014Feb 2014Mar 2014Apr 2014May 2014Jun 2014Jul 2014Aug 2014Sep 2014Oct 2014Nov 2014Dec 2014
Revenue
Forecast
Budget

Is there a way to create the columns dynamically, as for example, to calculate Revenue the logic remains same for each column but for every iteration the month changes.


Thanks.

6 Replies
MK_QSL
MVP

Do you want to create MonthYear for 2014 only or is there any specific logic (i.e. last 12 months) behind this?

Kindly provide some more information...

Not applicable
Author

you can create table with auto genenated column by uing ValueList in calculated dimension.

Anonymous
Not applicable
Author

Yes there is a logic.

The 12 months will be populated according to today's date. Similarly, the values of Revenue, Forecast and Budget will be calculated for each populated month.

For example: today is 9th Dec so, the data will be shown for rolling 12 months i.e. 10th dec 2013 to 9th dec 2014.

MK_QSL
MVP

I am not going to create a Database for giving the answer but if you have data, you can use below to create your expressions

Label of Expression

Date(MonthStart(Today()),'MMM-YYYY') //This will give you Dec-2014

Expression

SUM({<Date = {">=$(=AddYears(Today()+1,-1) )<=$(=AddYears(Today(),0))"}>}Revenue)

For Nov-2014

Date(MonthStart(Today(),-1),'MMM-YYYY')

SUM({<Date = {">=$(=AddYears(Today()+1,-2) )<=$(=AddYears(Today(),-1))"}>}Revenue)

Hope this would help

Not applicable
Author

Hi utkarsh garg

R u looking to add dynamic columns according to the selection

plz let me now

i will send u qvw file