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

Announcements
FLASH SALE: Save $500! Use code FLASH2026 at checkout until Feb 14th at 11:59PM ET. Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
NavinReddy
Creator II
Creator II

MTD

Dear All,

LOAD * INLINE [

    Date, Salary

    01/01/2014, 100

    03/01/2014, 200

    06/01/2014, 300

    07/01/2014, 400

    10/02/2014, 500

    11/02/2014, 600

    12/02/2014, 700

    13/01/2014, 800

];

I have simple data, In this data how can i fetch Current month Salaries how can i fetch

=sum({<Date={'>=$(=MonthStart)<=$(=MonthEnd)'}>}Salary)

i Tried this expression but it is not working

Thanks In Advance

Niranjan

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

=sum({<Date={">=$(=MonthStart(Today(), 'DD/MM/YYYY'))<=$(=Date(Today(), 'DD/MM/YYYY'))"}>}Salary)

Regards,

Jagan.

View solution in original post

6 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

To base the month on today's date:

=sum({<Date = {'>=$(=MonthStart(Today())) <=$(=MonthEnd(Today())'}>} Salary)

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sundarakumar
Specialist II
Specialist II

U want to restrict in edit script itself or u want them to hide them while showing charts?

-Sundar

sundarakumar
Specialist II
Specialist II

Hi Niru,

If you want to restrict the data in edit script then you can use PFA(inline)

 

load

* inline
[
date,salary
1/1/2012,100
2/2/2012,200
3/3/2012,300
1/1/2014,400
2/2/2014,500
]

where date>monthstart(today());

If you want to restrict in the chart you can do it as PFA(inline_chart)
Hope this helps

-Sundar

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

=sum({<Date={">=$(=MonthStart(Today(), 'DD/MM/YYYY'))<=$(=Date(Today(), 'DD/MM/YYYY'))"}>}Salary)

Regards,

Jagan.

jagan
Partner - Champion III
Partner - Champion III

Hi,

Can you close this post also.

Regards,

Jagan.

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Your best bet for selecting a month is to split the month out in the load script.  This can then be selected in a list box or used as a dimension etc..  The code for this is:

LOAD

     Date,

     Salary,

     Month(Date) as Month,

     Date(MonthStart(Date), 'MMM-YY') as [Month Year],

     Year(Date) as Year

INLINE [

    Date, Salary

    01/01/2014, 100

    03/01/2014, 200

    06/01/2014, 300

    07/01/2014, 400

    10/02/2014, 500

    11/02/2014, 600

    12/02/2014, 700

    13/01/2014, 800

];

You could then create a variable, called vCurrentMonth with the following code:

=Date(today(), 'MMM-YY')

And your expression would be:

=sum({<[Month Year]={'$(vCurrentMonth)'}>}Salary)

There are a lot more date functions you can use to split your date out into various permutations (Day, WeekDay, Week etc.) you will find information on this in the help or on line.

I've a couple of examples on Qlik Community of period to date and prior period that you may want to take a look at:

QlikView App: Simple Year To Date Example (Set Analysis)

QlikView App: Set Analysis - Prior Period Comparison

Hope that helps

Steve