How to Sum two columns and merge it into one? - merge

Right now my table is like:
But I want to show my table like:
I want to show the values in a single column for Shipment and Receipt, new to Qlikview so dont have any idea. Need guidance. Thanks in advance.

I think your problem is in the data model itself. 'Locked Trips S' is only referring to the 'Shipment' but has a value in 'Receipt' too. That shouldn't be a connection between these fields. Maybe provide a short screenshot of your data. That would help a lot :) !
And what about the 'Not Loaded Trips'? Where/How do you get it?
I would have commented this but I don't have the privilege :)

Problem solved, there is a column in database that contains the values - Shipment and Receipt,I used that column as dimension and removed null values with this calculated dimension:
=if([Transaction Type]<>' ',[Transaction Type])
and then in expression I wrote the expression =Count({}) as required.

Related

Tableau converting dimension to measure

I have a technical question relating to Tableau. I have a Category field in the dimensions section which has three indicators: Disposable Income, GDP and Consumer Expenditure. I would like to convert 'Disposable Income' into a measure value on its own.
Is this possible to do?
I cannot share the Tableau data source due to data restrictions.
It is very easy. Add a calculated field named Disposable Income as-
IF [category] = 'Disposable Income' THEN [Measure_Val] END
Needless to say [Measure_val] is your measure field name here.
Alternate solution to your problem I propose here, but it needs reshaping your data altogether. I have created a sample data for explanation like this
select three years column and click on pivot.. you will get a view like this after renaming the fields appropriately
From here you can proceed as described above.

Tableau Fixed Calculation Summing too much data

I have volume data for specific customers. The customer names come from salesforce and the volume comes from another table. When I add each in tableau, i get a nice table that seems to be working.
We can see that there are 19 values ~500 My ultimate goal is to sum these based upon filters.
A way i discovered that i can do that is to use the syntax
{ FIXED [Account Id]: count([Volume]) }
But when i do that,
I get
When I change my function to count([volume]) i get a count of all joined rows ~250k
My question is how do i make this respect indivudal entries in the database and not all the joined values? If there was a way to do the sum for distinct timestamps in another field this would also work? Any other advice would be helpful from you tableau experts.
Thanks!
I think i got it. In the table of the database that i was trying to calculate there were 20 rows that needed to be calculated. When the data was joined in SF, it duplicated the rows. The trick here was to do the sum of the max for each primary key
SUM({ FIXED [Pk], [Name1] : MAX([Volume]) })

How to split value of a VARCHAR column for every 2 charactes in System i Navigator (AS/400)

First of all, hi everyone, I hope you're having a great day.
So here's my problem.
I have a column in my table that consist of values all append together like
1120304050607080
I need to get this value and then split it into many 2 digit values so i can use them in another query like
WHERE model in ('11,20,30,40,50,60,70,80') ...
Is this possible to do in a Db2 iSeries Navigator query ? If not, is there another way around ?
Thanks
Have a great day !
EDIT: Seems like the solution will be to do a function. I haven't done a function in iseries before so if anyone is willing to help, i'll take it !

How to calculate cumulative field values in report

I am new to JasperReports and iReport, and I am facing a problem. Before going through the question, first, please take a look at the following image:
So, the main problem is with the cumulative columns. Per say, the "Cumulative Bill" column should show the following values sequentially:
6000.0, 14000.0, 23000.0, 32800.0, 42800.0 and 45800.0
I have no idea how this can be done. I tried creating a new variable, but there is no cumulative type calculations there. Please assist me.
Create variable $V{variableName} with calculation = Sum and Variable expression = $F{BillAmountField} and put text field with this variable into detail section.
Is it so hard? :)
It can be done at the query level, here is the query :-
SELECT m.bill_amount,
#cbill:=#cbill+ifNull( m.bill_amount,0) cumulative_bill
FROM (
SELECT #cbill:=0,
bill_amount
FROM
)m

add extra column value to a column sum

I have the following issue: I have a report that uses a Dataset as its datasource. The dataset has two tables, one would be the main table, say Employee, and the second table is EmployeePaycheck, so an employee can have several paychecks. I can compute the sum of a column in the second table, say paycheckValue, but what I can't seem to do is also add to this computed field the value of some additional fields in the Employee table, such as ChristmasBonus or YearlyBonus, to see how much the employee was paid at the end of the year.
Without knowing more information on this it will be difficult to answer, but I'll give you a couple things to look for.
First, I would make sure that the fields are of a similar type that will allow for a summary. For example, if one is a string then a summary wouldn't be able to be done without casting or convertingthe value to a number. I'm assuming that the fields are probably number or decimal columns so that is probably not the case.
I'd also check to make sure that none of the values that you are trying to sum are null. I haven't tested this, but I believe that it will not sum correctly if one of the rows has a null value. In this scenario you should just be able to use a formula field to check for the null and if the field is null return 0 instead. Then you can use the formula field in your calculations instead of the field itself.
If neither of these are the case please provide a little more info how you are computing the fields and what is happening when you do it.
Hope this helps.