Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
konidena
Creator
Creator

How to select Previous month

Hi Team,

In my SQL server database i have a field called Full_date. It is varchar(8) type.

to use this field in my QV application, i used Convert(date, Full_date) to convert into date data type.

Now, i made a date, month, year fields using the above field.

Month(Fulldate) as Month,

Year(Fulldate) as Year,

Day(Fulldate) as Date

I have created the Pivot table to show the current month sales, Previous month sales, current month target and previous month target.

My selections as below.

First i am selecting the Year, then ;month.

When i select month, the report should should show both current month and previous month sales and target.

When i use code "Month(Num(Month)-1)" is giving "Dec" month on the current selected month is "Feb". Actually it should give month "Jan" as my previous month.

Please help me in selecting the earlier month.

if i select "Jan" it should show "Dec"

if i select "Mar" it should show "Feb"

Regards

Srinivas

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Are you sure that Convert(date, Full_date) converted your varchar values into correct dates?

Perhaps you can post a small Qlikview that demonstrates the problem.


talk is cheap, supply exceeds demand
Anonymous
Not applicable

Please post sample data .