Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

closing opening

Dear friends

i have following senario that is

month  opening  closing

apr       100          200

may      200         500

jun        300         700

july       250         850

so if i selet one month it should show one month opening and closing

if i select  apr may jun   it should show apr month opening and july month closing dynamically

any idea please share

4 Replies
Gysbert_Wassenaar

Your data needs to be ordered by month. Ideally you'd have a date field. In the example the data is already ordered by month so I add a row field so I have a numeric field to use to find the first and last month of the selection.

Data:

LOAD *, recno() as row INLINE [

    month,  opening,  closing

    apr,       100,     200

    may,     200,     500

    jun,       300,     700

    july,      250,     850

];

In a straight chart or pivot table add month as dimension and two expressions:

Expression 1 (opening): firstsortedvalue(opening, row)

Expression 2 (closing): firstsortedvalue(closing, -row)


talk is cheap, supply exceeds demand
lironbaram
Partner - Master III
Partner - Master III

i have a look at the attach file

Not applicable
Author

You could add a monthnumber :

LOAD * INLINE [
     monthnum, month, opening, closing
     1, apr, 100, 200
     2, may, 200, 500
     3, jun, 300, 700
     4, july, 250, 850
];

and then use

=FirstSortedValue(opening,monthnum)

=FirstSortedValue(closing,-monthnum)



kumarnatarajan
Partner - Specialist
Partner - Specialist

hi,

Find the attached file.